<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" method="post">
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">添加群发消息</div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">消息类型 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <select v-model="selected" style="width:150px;" name="data[msg_type]" required>
                                        <option value="">请选择消息类型</option>
										<option value="news">图文消息</option>
										<option value="text">文本消息</option>
										<option value="image">图片消息</option>
										<option value="video">视频消息</option>
										<option value="voice">语音消息</option>
										<option value="music">音乐消息</option>
										<option value="wxcard">卡券消息</option>
                                    </select>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">消息标题 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="data[title]"
                                           value="" required>
                                </div>
                            </div>
                            <div v-if="selected != ''" class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">
									消息内容 <span v-if="selected != 'text'" class="tpl-form-line-small-title">{{selected=='wxcard'?'CARD_ID':'MEDIA_ID'}}</span> 
								</label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="data[content]" required>
									<small v-if="selected == 'news'">获取 <a href="{:url('wechat.material.text/index')}">图文素材MEDIA_ID</a></small>
									<small v-if="selected == 'image'">获取 <a href="{:url('wechat.material.image/index')}">图片素材MEDIA_ID</a></small>
									<small v-if="selected == 'video'">获取 <a href="{:url('wechat.material.video/index')}">视频素材MEDIA_ID</a></small>
									<small v-if="selected == 'voice'">获取 <a href="{:url('wechat.material.voice/index')}">语音素材MEDIA_ID</a></small>
								</div>
							</div>
							<div v-if="selected == 'image'">
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">推荐语 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="data[recommend]"
                                           value="" required>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">开启评论 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="data[need_open_comment]" value="1" data-am-ucheck
                                               checked>
                                        开启
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="data[need_open_comment]" value="0" data-am-ucheck>
                                        关闭
                                    </label>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">谁可评论 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="data[only_fans_can_comment]" value="1" data-am-ucheck
                                               checked>
                                        粉丝
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="data[only_fans_can_comment]" value="0" data-am-ucheck>
                                        所有人
                                    </label>
                                </div>
                            </div>
							</div>
							<div v-if="selected == 'news'" class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">判定为转载时 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="data[send_ignore_reprint]" value="0" data-am-ucheck
                                               checked>
                                        停止群发
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="data[send_ignore_reprint]" value="1" data-am-ucheck>
                                        继续群发
                                    </label>
                                </div>
                            </div>
							<div v-if="selected == 'image'" class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">素材描述 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="data[description]"
                                           value="" required>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
                                    <button type="submit" class="j-submit am-btn am-btn-secondary">提交
                                    </button>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script>

    $(function () {
		new Vue({
		  el: '#my-form',
		  data: {
			selected:''
		  }
		});
        $('#my-form').formPost();

    });
</script>
